home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_adjoindoor.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  101 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_Door.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [IS]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message        startup        
  15.     message        entered    
  16.     message     pulse
  17.     message        blocked        
  18.  
  19.     thing       player              local
  20.     thing        door0
  21.     sector      sector0             linkid=3
  22.     sector      sector1             linkid=3
  23.     sector      sector2             linkid=3
  24.  
  25.     float        moveSpeed=8.0
  26.     float        sleepTime=2.0
  27.  
  28.     vector        vecLightValue        local
  29.     int         alreadyin=0         local
  30.  
  31. end
  32.  
  33. # ========================================================================================
  34.  
  35. code
  36.  
  37. startup:
  38.  
  39.     player=GetLocalPlayerThing();
  40.     SectorAdjoins(sector1, 0);
  41.     
  42. return;
  43.  
  44. # ........................................................................................
  45. entered:
  46.  
  47.     if (alreadyin == 1) return;
  48.     if (GetSenderID() == 3)
  49.     {
  50.         alreadyin = 1;
  51.         SetPulse(1);
  52.         MoveToFrame(door0, 1, 2);
  53.         SectorAdjoins(sector1, 1);
  54.     }
  55.  
  56. return;
  57.  
  58. # ........................................................................................
  59. pulse:
  60.  
  61.     //print("pulse hit");
  62.     //printint(SectorPlayerCount(sector0));
  63.     //printint(SectorPlayerCount(sector1));
  64.     //printint(SectorPlayerCount(sector2));
  65.     
  66.     if ((SectorPlayerCount(sector0) == 1) ||
  67.         (SectorPlayerCount(sector1) == 1) ||
  68.         (SectorPlayerCount(sector2) == 1))
  69.         {
  70.             alreadyin = 1;
  71.             return;
  72.         }
  73.         
  74.     if ((SectorPlayerCount(sector0) == 0) &&
  75.         (SectorPlayerCount(sector1) == 0) &&
  76.         (SectorPlayerCount(sector2) == 0))
  77.         {
  78.             alreadyin = 0;
  79.             MoveToFrame(door0, 0, 2);
  80.             SectorAdjoins(sector1, 0);
  81.             SetPulse(0);
  82.             return;
  83.         }
  84.         
  85. return;
  86.  
  87. # ........................................................................................
  88. blocked:
  89.     
  90.     if (GetSenderRef() == door0)
  91.     {    
  92.         MoveToFrame(door0, 0, 2);
  93.     }
  94.     
  95. return;
  96.  
  97. # ........................................................................................
  98.  
  99. end
  100.  
  101.